﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using cs499.Database;

namespace cs499.TimeSlots
{
    public partial class DeleteTimeSlots : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void CancelButton_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/TimeSlots/ListTimeSlots.aspx");
        }

        protected void Page_PreRender(object sender, EventArgs e)
        {
            LinkButton timeslotsMenuButton = (LinkButton)Master.FindControl("LoginView").FindControl("TimeSlotsMenuButton");
            timeslotsMenuButton.CssClass = "selected";
        }

        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int timeslotid = (int)GridView1.DataKeys[e.RowIndex].Value;
            ListOfDepartment.DeleteTimeSlot(ID: timeslotid);
            //cs499.Database.ListOfDepartment.GetDepartment(ID: CurrentDepartmentId).Places.Remove();
            e.Cancel = true;
            Response.Redirect("~/TimeSlots/DeleteTimeSlots.aspx");
        }
    }
}